<?php
/* @var $this RecetaController */
/* @var $model Receta */

$this->breadcrumbs=array(
	'Recetas'=>array('index'),
	'Manage',
);

$this->menu=array(
	array('label'=>'Crear Receta', 'url'=>array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$('#receta-grid').yiiGridView('update', {
		data: $(this).serialize()
	});
	return false;
});
");
?>
<?php echo CHtml::link('B&uacute;squeda Avanzada','#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">

</div><!-- search-form -->

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'receta-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		//'idReceta',
		array('name'=>'fecha',
			  'value'=>'Yii::app()->dateFormatter->format("dd/MM/yyyy",strtotime($data->fecha))',
				),
		array('value'=>'$data->cliente0->fullName',),
		array('name'=>'medico','value'=>'$data->medico0->nombre'),
		//'sucursal',
		//'observacion',
		array(
			'class'=>'CButtonColumn',
			'template'=>'{view}{delete}'
		),
	),
)); ?>
